package bsc.war.ajax;

import bsc.ejb.entity.Person;
import bsc.ejb.entity.SRM;
import bsc.war.delegate.DelegateBSC;
import bsc.war.factory.Factory;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.math.NumberUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

/**
 *
 * @author Miguel Angel
 */
public class EditSRM extends AbstractController {

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        try {

            DelegateBSC delegate = (DelegateBSC) Factory.getBean("DelegateBSC");
            Long idSRM = Long.parseLong(request.getParameter("srm"));

            SRM srm = delegate.findSRM(idSRM);

            request.setAttribute("srm", srm);


        } catch (Exception e) {
            e.printStackTrace();
        }

        return new ModelAndView("editSRM");
    }
}